<include file="Public/header" /> 

<!--主窗体-->
<div class="container app">
	<!--左侧菜单-->
	<include file="Public/sidebar" /> 
	<!--左侧菜单//-->
	
	<!-- mainCon -->
	<div id="mainCon" class="mainCon">
		<h4>素材审核</h4>
		<form class="form-horizontal" id="myform">
			<div class="form-group">
				<label for="mobile" class="col-sm-2 control-label">类型</label>
				<div class="col-sm-5">
					<p class="form-control-static text-info"><{$type_list[$result['type']]}></p>
				</div>
			</div>

			<div class="form-group">
				<label for="createtime" class="col-sm-2 control-label">标题</label>
				<div class="col-sm-5">
					<p class="form-control-static text-info">
						<{$result['title']}>
					</p>
				</div>
			</div>
			
			<div class="form-group">
				<label for="weixin" class="col-sm-2 control-label">上传时间</label>
				<div class="col-sm-5">
					<p class="form-control-static text-info">
						<{$result['createtime']|date='Y-m-d H:i:s',###}>
					</p>
				</div>
			</div>
			
			<if condition="$result['type'] == '2'"> 
				<div class="form-group">
					<label for="password" class="col-sm-2  control-label">图片</label>
					<div class="col-sm-5">
						<img src="/<{$result['upload_address']}>" style="width:300px;height:300px;">
					</div>
				</div>
			<elseif condition="$result['type'] == 1"/>
			
				<iframe height="480" width="400" src="<{$result['upload_link']}>" frameborder="0" allowfullscreen="" style="width: 100%; height: 300px;"></iframe>
				
			<elseif condition="$result['type'] == 3" />
				
				<div class="form-group">
					<label for="cid" class="col-sm-2 control-label">所属分类</label>
					<div class="col-sm-5">
						<select class="form-control" name="cid">
							<option value="0">-请选择分类-</option>
							<foreach name="cate" item="vo">
								<option value="<{$vo['id']}>" <if condition="$result['cid'] eq $vo['id']">selected</if>><{$vo['name']}></option>
							</foreach>
						</select>
					</div>
				</div>
				
					
				<div class="form-group">
					<label for="weixin" class="col-sm-2 control-label">视频封面</label>
					<div class="col-sm-5">
						<p class="form-control-static text-info">
							<img src="/<{$result['video_picture']}>" style="width:300px;height:300px;">
						</p>
					</div>
				</div>
				
				<iframe height="480" width="400" src="<{$result['upload_link']}>" frameborder="0" allowfullscreen="" style="width: 100%; height: 300px;"></iframe>
				
			</if>

			<div style="clear:both;"></div>
			<if condition="$result['is_pass'] == '0'">
				<div class="form-group" style="margin-top: 25px;">
					<div class="col-sm-offset-2 col-sm-10">
						<input type="hidden" name="type" value="<{$result['type']}>">
						<button  class="btn btn-default col-sm-2 delAct" data-id="<{$result['id']}>" data-type="1">审核通过</button>
						<button  class="btn btn-default col-sm-2 delAct" data-id="<{$result['id']}>" data-type="-1" style="margin-left:20px;">审核不通过</button>
					</div>
				</div>
			</if>
		</form>
		
	</div>
	<!-- mainCon// -->
	
</div>
<!--主窗体//-->

<script src="__PUBLIC__/js/layer/layer.js"></script>
<script src="__PUBLIC__/js/validate/jquery.validate.min.js"></script>
<script src="__PUBLIC__/js/validate/messages_zh.js"></script>
<script>
$(function(){
	
	$(".delAct").click(function(){
		var that = this;
		var do_type = $(that).attr('data-type'); //用户执行操作
		var cid  = $('select[name="cid"]').val();
		var type = $('input[name="type"]').val();
	
		if(do_type == '1'){
			var string = '您确定通过审核吗';
		}else{
			var string = '您确定不通过审核吗';
		}
		
		layer.confirm(string, {icon: 3, title:'提示'}, function(index){
			var itemid = $(that).attr("data-id");
			$.post("<{:U('upload_material_edit')}>",{id:itemid,do_type:do_type,cid:cid,type:type},function(r){
				if(r.status != 1){
					layer.close(index);
					layer.alert(r.info,{icon: 2});
				}else{
					window.location.href = "<{:U('Admin/Material/upload_material_list',array('k'=>10))}>";
				}
			});
		});
		return false;
	});
	
	
});
</script>

<include file="Public/footer" /> 